package com.fh.service.customer;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.fh.dao.DaoSupport;
import com.fh.entity.CustomerEntity;
import com.fh.entity.Page;
import com.fh.util.PageData;

/**
 * @ClassName: OrderService
 * @Description:(PC端客户管理service)
 * @author: 张鹏强
 * @date: 2017-3-27 上午8:37:17
 * 
 */
@Service("customerService")
public class CustomerService {
	@Resource(name = "daoSupport")
	private DaoSupport dao;
    /**
     * 查询客户管理总条数
     * @param pd
     * @return
     * @throws Exception 
     */
	public int queryCustomerCount(Page pd) throws Exception {
		return (Integer) dao.findForObject("CustomerMapper.findCustomerCount", pd);
	}
    /**
     * 查询客户管理列表
     * @param pd
     * @return
     * @throws Exception 
     */
	@SuppressWarnings("unchecked")
	public List<CustomerEntity> queryCustomerList(Page pd) throws Exception {
		return (List<CustomerEntity>) dao.findForList("CustomerMapper.findCustomerList", pd);
	}
	/**
	 * 根据顾客id查询顾客详情
	 * @param pde
	 * @return
	 * @throws Exception 
	 */
	public CustomerEntity findCustomerInfoById(PageData pde) throws Exception {
		return (CustomerEntity) dao.findForObject("CustomerMapper.findCustomerInfoById", pde);
	}
	/**
	 * 根据顾客id查询顾客头像
	 * @param id
	 * @return
	 * @throws Exception 
	 */
	public CustomerEntity queryPic(String id) throws Exception {
		return (CustomerEntity) dao.findForObject("CustomerMapper.queryPic", id);
	}

}
